<template>
  <div class="">
    <van-nav-bar
      @click-left="$router.back()"
      left-arrow
      title="提交客户详情"
      fixed
    ></van-nav-bar>
    <main>
      <header>
        <div class="left">
          <img :src="$publicObj.urlImg(formData.cover)" alt="" />
        </div>
        <div class="right">
          <h3>{{ formData.title }}</h3>
          <p>{{ formData.gmtCreate }}</p>
        </div>
      </header>
      <div class="content">
        <van-cell title="头像">
          <template #default>
            <img :src="$publicObj.urlImg(formData.img)" class="imgs" alt="" />
          </template>
        </van-cell>
        <van-cell title="姓名" :value="formData.name" />
        <van-cell title="电话" :value="formData.phone" />
        <van-cell title="备注" :value="formData.remark" />
      </div>
    </main>
  </div>
</template>

<script>
// 引入echarts
export default {
  name: "",
  data() {
    return {
      formData: {},
    };
  },
  //生命周期 - 创建完成（访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（访问DOM元素）
  mounted() {
    // document.querySelector("#app").style.backgroundColor = "#f3f5f7";
    this.getFormMessage();
  },
  methods: {
    //获取表单详情
    async getFormMessage() {
      let res = await this.$api.getFormMessage({ id: this.$route.query.id });
      if (res.code !== 0) return;
      this.formData = res.data;
    },
  },
};
</script>
<style scoped lang='less'>
/* @import url(); 引入css类 */
main {
  margin-top: 46px;
  padding: 0 15px;
  height: calc(100vh - 46px);
  header {
    margin-top: 55px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.08);
    display: flex;
    padding: 11px 8px;
    .left {
      img {
        width: 88px;
        height: 88px;
      }
    }
    .right {
      margin-left: 13px;
      h3 {
        margin-top: 6px;
        font-size: 14px;
        color: #000000;
      }
      p {
        margin-top: 45px;
        font-size: 12px;
        color: #999999;
      }
    }
  }
  .content {
    margin-top: 15px;
    background-color: #ffffff;
    border-radius: 5px;
    box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.16);
    .imgs {
      width: 45px;
      height: 45px;
      border-radius: 50%;
    }
  }
}
/deep/ .van-cell__title {
  display: flex;
  align-items: center;
}
</style>